package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Orders generated by hbm2java
 */
@Entity
@Table(name = "ORDERS", schema = "PUBLIC", catalog = "PUBLIC")
public class Orders implements java.io.Serializable {

	private Integer id;
	private Objects objectsByProjectId;
	private PaymentsTypes paymentsTypes;
	private Objects objectsByProviderId;
	private Date date;
	private BigDecimal total;
	private Set<OrdersEquipments> ordersEquipmentses = new HashSet<OrdersEquipments>(
			0);

	public Orders() {
	}

	public Orders(Objects objectsByProjectId, PaymentsTypes paymentsTypes,
			Objects objectsByProviderId, Date date, BigDecimal total) {
		this.objectsByProjectId = objectsByProjectId;
		this.paymentsTypes = paymentsTypes;
		this.objectsByProviderId = objectsByProviderId;
		this.date = date;
		this.total = total;
	}

	public Orders(Objects objectsByProjectId, PaymentsTypes paymentsTypes,
			Objects objectsByProviderId, Date date, BigDecimal total,
			Set<OrdersEquipments> ordersEquipmentses) {
		this.objectsByProjectId = objectsByProjectId;
		this.paymentsTypes = paymentsTypes;
		this.objectsByProviderId = objectsByProviderId;
		this.date = date;
		this.total = total;
		this.ordersEquipmentses = ordersEquipmentses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false)
	public Objects getObjectsByProjectId() {
		return this.objectsByProjectId;
	}

	public void setObjectsByProjectId(Objects objectsByProjectId) {
		this.objectsByProjectId = objectsByProjectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PAYMENT_TYPE_ID", nullable = false)
	public PaymentsTypes getPaymentsTypes() {
		return this.paymentsTypes;
	}

	public void setPaymentsTypes(PaymentsTypes paymentsTypes) {
		this.paymentsTypes = paymentsTypes;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROVIDER_ID", nullable = false)
	public Objects getObjectsByProviderId() {
		return this.objectsByProviderId;
	}

	public void setObjectsByProviderId(Objects objectsByProviderId) {
		this.objectsByProviderId = objectsByProviderId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date", nullable = false, length = 10)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(name = "TOTAL", nullable = false, precision = 128, scale = 0)
	public BigDecimal getTotal() {
		return this.total;
	}

	public void setTotal(BigDecimal total) {
		this.total = total;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orders")
	public Set<OrdersEquipments> getOrdersEquipmentses() {
		return this.ordersEquipmentses;
	}

	public void setOrdersEquipmentses(Set<OrdersEquipments> ordersEquipmentses) {
		this.ordersEquipmentses = ordersEquipmentses;
	}

}
